import ctypes as ct
from datatypes import *

lib = ct.CDLL('/home/zhengankun/.local/lib/libbinn.so')

lib.binn_free.argtypes = [ct.c_voidp]

def binn_free(binn):
    if not isinstance(binn, ct.c_voidp):
        binn = ct.c_voidp(binn)
    return lib.binn_free(binn)


lib.binn_type.restype = ct.c_int
def binn_type(binn):
    if not isinstance(binn, ct.c_voidp):
        binn = ct.c_voidp(binn)
    return lib.binn_type(binn)
    
lib.binn_ptr.restype = ct.c_voidp
lib.binn_ptr.argtype = [ct.c_voidp]


def binn_ptr(binn):
    if not isinstance(binn, ct.c_voidp):
        binn = ct.c_voidp(binn)
    return lib.binn_ptr(binn)


lib.binn_open.restype = ct.c_voidp
lib.binn_open.argtypes = [ct.c_voidp]


def binn_open(pbuf):
    return lib.binn_open(ct.c_voidp(pbuf))



lib.binn_object.restype = ct.c_voidp


def binn_object():
    return lib.binn_object()


lib.binn_list.restype = ct.c_voidp


def binn_list():
    return lib.binn_list()




